Release v0.8.0#132
Merged
Merged
Conversation
Prometheus uses a pull model requiring long-running HTTP servers, which is incompatible with MSR's CLI-based ephemeral execution model.
Updated docs/development/publishing.md to reflect tag-based automated publishing workflow instead of manual npm publish commands. Changes: - Automated publishing via git tag push - NPM_TOKEN secret management and renewal process - Provenance verification steps - Emergency manual publishing fallback - Updated quick reference commands
Foundation for preventing concurrent migration execution in production deployments (Kubernetes, CI/CD pipelines). Added: - ILockingService<DB> with two-phase locking protocol (acquire → verify) - ILockStatus for CLI lock status queries - LockingConfig with validation (timeout, retries, SQL injection protection) - Config.locking property (default: enabled, 10min timeout, fail-fast) - IDatabaseMigrationHandler.lockingService (optional, adapter-specific)
Added two-phase locking (acquire → verify → release) to MigrationWorkflowOrchestrator. Wraps migrateAll() and migrateToVersion() with unique executor ID (hostname-pid-uuid). Features: fail-fast default, retry logic, graceful degradation, always releases in finally.
Implemented lock:status and lock:release commands plus --no-lock flag. New CLI commands: - lock:status: Display current lock holder, timestamps, and expiration - lock:release --force: Force-release stuck locks with confirmation prompt New features: - --no-lock flag: Disable locking for single migration run - Public API methods: getLockStatus(), forceReleaseLock() on MigrationScriptExecutor - flagMapper support for --no-lock mapping to config.locking.enabled Safety features: - Requires --force flag to release locks - Interactive confirmation prompt before releasing - Detailed warnings about dangers of force-releasing active locks
Added comprehensive documentation for lock management CLI commands. Documentation: - Created lock-commands.md guide for CLI lock operations - Created locking-settings.md for configuration reference - Updated comparison.md, ci-cd-integration.md, cli-vs-api.md, docker-kubernetes.md, production-deployment.md with locking info Tests (to maintain 100% coverage): - Added lock-status.test.ts, lock-release.test.ts, askForConfirmation.test.ts - Refactored lock commands for testability via dependency injection
The test/fixtures/migrations/empty directory is required by integration tests but was not tracked in git. Added .gitkeep to ensure directory exists in CI environments. Fixes CircleCI: "ENOENT: no such file or directory, scandir './test/fixtures/migrations/empty'"
…mechanism #85: Add locking mechanism
…stem scripts Fixed "TypeError: s.init is not a function" error when calling executor.down(). Root Cause: - migrationScanner.scan() returns scripts.migrated as plain objects from DB - Plain objects lack filepath property and init() method - prepareRollbackScripts() tried to call init() on plain objects Solution: - Added matchMigratedWithScripts() helper to match DB records with filesystem - Maps migrated records (plain objects) to MigrationScript instances (with filepath) - Throws clear error if migration file is missing from filesystem Changes: - Added private matchMigratedWithScripts() method in MigrationRollbackManager - Updated rollbackToVersion() to use matched scripts before calling init()
Added optional THandler generic parameter for type-safe handler access in adapters. Changes: - Added THandler generic with default IDatabaseMigrationHandler<DB> - Updated MigrationScriptExecutor<DB, THandler> class signature - Updated IMigrationExecutorDependencies<DB, THandler> interface - Changed handler assignment to preserve type from dependencies - Added comprehensive JSDoc with adapter usage examples Benefits: - Type-safe access to handler properties in adapter implementations - Eliminates need for casting and bracket notation workarounds - Backwards compatible - default type parameter maintains existing behavior - Better IDE autocomplete for adapter-specific handler properties
Created comprehensive v0.7-to-v0.8 migration guide with feature documentation and examples. Updated all documentation files: - README.md and docs/index.md with v0.8.0 "What's New" sections - Reorganized version migration index with "Current" and "Previous Releases" - Updated API docs for lockingService and THandler generic parameter - Updated guide docs with locking examples (production-deployment, cli-adapter-development) - Enhanced comparison.md with detailed comparison tables for JS/TS and cross-platform tools
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Prometheus uses a pull model requiring long-running HTTP servers, which is incompatible with MSR's CLI-based ephemeral execution model.